using System;
using System.Collections.Generic;

namespace Runtime.Common.Interface
{
    /// <summary>
    /// 组合模式接口
    /// </summary>
    public interface IComposite
    {
        IGuidObject Id { get; }
        void AddChild(IComposite number);
        void RemoveChild(IComposite number);
        List<T> GetNumbers<T>() where T : IComposite;
        List<IComposite> GetNumbers();
        void Foreach(Action<IComposite> match);
        void ForeachByRecursion(Action<IComposite> match);
        T Find<T>(Func<IComposite, bool> fun) where T : IComposite;
        void Clear();
    }

    public interface IComposite<T> : IComposite
    {
        Dictionary<T, IComposite> dict { get; }
    }
}